import { DBPost } from '../../db/DBPost.js';

Page({
    data: {
        swiper: [{ pic: '/images/post-1@text.jpg', id: 3 },
            { pic: '/images/post-2@text.jpg', id: 4 },
            { pic: '/images/post-3@text.jpg', id: 5 }
        ],
    },
    onLoad: function(option) {
        var dbPost = new DBPost();
        this.setData({
            artcle: dbPost.getAllPostData()
        })
    },
    tapswiper: function(event) {
        var id = event.target.dataset.id;
        this.godetail(id);
    },
    tapartcle: function(event) {
        var id = event.currentTarget.dataset.id;
        this.godetail(id);
    },
    godetail:function(id){
    	wx.navigateTo({
        url: 'text-detail/text-detail?id='+id,
      })
    }

})